package com.zhuang.chapter12.work01;

import java.util.HashSet;

public class PersonTest {
	public static void main(String[] args) {
		HashSet<Person> set = new HashSet<Person>();
		Person p1 = new Person("张三", 22);
		Person p2 = new Person("张三", 21);
		set.add(p1);
		set.forEach(System.out::println);
		System.out.println(set.size());

		set.add(p2);
		set.forEach(System.out::println);
		System.out.println(set.size());

		System.out.println(p1.equals(p2));
	}
}
